/**
 * 
 */
package idv.takeshi.software.productline.bookstore.application.service;

import idv.takeshi.software.productline.bookstore.application.service.dto.MultiUserAccountDto;
import idv.takeshi.software.productline.bookstore.domain.model.useraccount.RoleDuplicateException;
import idv.takeshi.software.productline.bookstore.domain.model.useraccount.UserAccount;

import java.util.Set;

/**
 * A service for maintaining user accounts operations.
 * @author takeshi
 *
 */
public interface MaintainUserAccountsService {
	
	/**
	 * Get user account model by name.
	 * @param name
	 * @return
	 */
	public UserAccount getUserAccountByName(String name);
	
	/**
	 * Get user accounts by given role, accountName and accountType.
	 * @param role
	 * @param accountName
	 * @param accountType
	 * @return
	 */
	public Set<UserAccount> getUserAccountsByRoleAccountNameAndAccountType(
			String role, String accountName, String accountType);
	
	/**
	 * Get user account by id.
	 * @param id
	 * @return
	 */
	public UserAccount getUserAccountById(Long id);
	
	
	/**
	 * Update user account without validating user's password.
	 * @param userAccountDto
	 * @throws RoleDuplicateException 
	 */
	public void updateUserAccount(MultiUserAccountDto userAccountDto) throws RoleDuplicateException;
	
}
